namespace CthulhuDomain.GameEntities
{
  public class DrawableRectangle
  {
    public IColor Color { get; set; }
    public IVector2 Position { get; set; }
    public IRectangle DestinationRectangle { get; set; }
    protected int Width { get; set; }
    protected int Height { get; set; }
    public IGraphicResource Texture { get; set; }
    
    public DrawableRectangle(IGraphicResource texture, IVector2 position, IRectangle rectangle, IColor color) {
      Texture = texture;
      Position = new Vector2Adapter(position.X,position.Y);
      Width = rectangle.Width;
      Height = rectangle.Height;
      DestinationRectangle = new RectangleAdapter(0, 0, rectangle.Width, rectangle.Height);
      Color = color ?? new ColorAdapter(Microsoft.Xna.Framework.Color.White);
    }

    public void Draw(ISpriteBatch spriteBatch){
      spriteBatch.Draw(Texture, Position,new RectangleAdapter(0,0,Width,Height),Color);
    }
  }
}